// 针对coach的API操作都写在这里

import service from ".";

// 将所有的针对coach的请求，都封装到一个对象中
const coachApi = {
    add(coach){
        return service.post(
            '/coach',
            coach
        ).then(response=>response.data);
    },
    search(params){
        return service.get(
            '/coach',
            {params},    // 传递参数
        ).then(response=>response.data);
    },
    edit(coach){
        return service.put(
            '/coach',
            coach,
        ).then(response=>response.data);
    },
    remove(id){
        return service.delete(
            '/coach/'+id,
        ).then(response=>response.data);
    },
};

export default coachApi;